import warnings
warnings.filterwarnings('ignore')
from ultralytics import YOLO
 
if __name__ == '__main__':
    model = YOLO(r'D:\YOLOv11\ultralytics\cfg\models\11\yolo11n-seg.yaml')
    model.train(data=r'D:\YOLOv11\ct.yaml',
                cache=False,
                imgsz=640,
                epochs=100,
                # single_cls=True,  # 是否是单类别检测
                batch=16,
                close_mosaic=0,
                workers=8,
                device='0',
                optimizer='SGD',
                resume=True,
                amp=True,
                project='runs/train',
                name='922_n_v11',
                )